using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ResManager : MonoBehaviour
{
    public Sprite[] goodsIcons;
    public Sprite[] vegetableIcons;
    public Sprite[] drinksIcons;
    public Sprite[] canIcons;
    public Sprite[] headIcons;
    public static ResManager Instance;
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            InitializeResourceSystem();
        }
    }


    private void InitializeResourceSystem()
    {

    }

    public Sprite[] GetGoodsIcons()
    {
        int l = (int)UserManager.Instance.GetUserInfo()["CurrentLv"];
        int y = GetYCycledValue(l);

        if (y == 1)
        {
            return vegetableIcons;
        }
        else if (y == 2)
        {
            return goodsIcons;
        }
        else if (y == 3)
        {
            return drinksIcons;
        }
        else
        {
            return canIcons;
        }
    }

    private int GetYCycledValue(int x)
    {
        return (x - 1) % 3 + 1;
    }
    public Sprite[] GetHeadIcons()
    {
        return headIcons;
    }

    public Sprite[] GetVegetableIcons()
    {
        return vegetableIcons;
    }
}
